/*
PearReview - The peer review assistant.
Copyright (C) 2009  Dimitrij Pankratz, Anton Musichin
http://www.pearreview.com, info@pearreview.com

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

package com.pearreview.ui.slidebox;

import java.util.EventObject;

public class SlideBoxChangeEvent extends EventObject {
	private static final long serialVersionUID = 197333168656054301L;
	
	private Integer index;
	private Integer from;
	private Integer to;
	private Object e;
	
	public SlideBoxChangeEvent(Object source) {
		super(source);
	}

	public SlideBoxChangeEvent(Object source, Object e, int index) {
		this(source);
		this.e = e;
		this.index = index;
	}
	
	public SlideBoxChangeEvent(Object source, Object e, int from, int to) {
		this(source);
		this.e = e;
		this.from = from;
		this.to = to;
	}
	
	/**
	 * Returns removed, changed, added element.
	 * @return element
	 */
	public Object getElement() {
		return e;
	}
	
	/**
	 * Gets index of added, removed, updated element
	 * @return index of element
	 */
	public Integer getIndex() {
		return index;
	}
	
	/**
	 * Gets index of moved element from
	 * @return index of moved element
	 */
	public Integer getMovedFrom() {
		return from;
	}
	
	/**
	 * Gets index of moved element to
	 * @return index of moved element to
	 */
	public Integer getMovedTo() {
		return to;
	}
}
